package com.linux.huhx.main;

import com.linux.huhx.business.service.MyAspectService3;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author: huhx
 * @Date: 2017-12-15 下午 12:32
 * @Desc: 基于xml配置的aop测试主体类
 */
public class XmlServiceMain {
    private ApplicationContext context = null;

    @Before
    public void initApplicationContext() {
        context = new ClassPathXmlApplicationContext("application-xml.xml");
    }

    @Test
    public void aspectServiceTest_1() {
        MyAspectService3 myAspectService1 = context.getBean("myService", MyAspectService3.class);
        myAspectService1.serviceMethod();
    }
}